{template "topic_header"}
<link href="styles/theme.css" rel="stylesheet" type="text/css" />
<style>

/* star */
#star {
	position: relative;
	height: 24px;
}

#star ul,#star span {
	float: left;
	display: inline;
	height: 19px;
	line-height: 19px;
}

#star ul {
	margin: 0 10px;
}

#star li {
	float: left;
	width: 24px;
	cursor: pointer;
	text-indent: -9999px;
	background: url(./images/offer/star.png) no-repeat;
}

#star strong {
	color: #f60;
	padding-left: 10px;
}

#star li.on {
	background-position: 0 -28px;
}

#star p {
	position: absolute;
	top: 20px;
	width: 159px;
	height: 60px;
	display: none;
	background: url(./images/offer/icon.gif) no-repeat;
	padding: 7px 10px 0;
}

#star p em {
	color: #f60;
	display: block;
	font-style: normal;
}

/* star */
#vstar {
	position: relative;
	height: 24px;
}

#vstar ul,#vstar span {
	float: left;
	display: inline;
	height: 19px;
	line-height: 19px;
}

#vstar ul {
	margin: 0 10px;
}

#vstar li {
	float: left;
	width: 24px;
	cursor: pointer;
	text-indent: -9999px;
	background: url(./images/offer/star.png) no-repeat;
}

#vstar strong {
	color: #f60;
	padding-left: 10px;
}

#vstar li.on {
	background-position: 0 -28px;
}

#vstar p {
	position: absolute;
	top: 20px;
	width: 159px;
	height: 60px;
	display: none;
	background: url(./images/offer/icon.gif) no-repeat;
	padding: 7px 10px 0;
}

#vstar p em {
	color: #f60;
	display: block;
	font-style: normal;
}
</style>
<div class="appframe">
	<div class="appframeTitle">
		<span class="mleft">悬赏</span>
	</div>

	<div class=""></div>


	<div class="themepwarp"
		style="overflow: hidden; padding-bottom: 100px;">
			
							<div class="avatar">
					<a href="index.php?mod=offer&view=me&uid=$val[uid]"
						class="nude_face"><img width="70" height="70"
						src="{$user['face']}"
						onerror="javascript:faceError(this);" /></a>
昵称：{$user['nickname']}
等级：{$user['level']}
				</div>
		
		标题：{$offerInfo[title]} 内容：{$offerInfo[content]}
		
							<!--{loop $offerInfo[images] $iv}-->
					<img src="{$iv[photo]}" width="150" height="150" class="showcursor">
					<!--{/loop}-->
		<!--{if $offerInfo[uid]==MEMBER_ID}-->
		
		<!--{/if}-->



		<!--{if 'admin' == MEMBER_ROLE_TYPE &&$offerInfo[status]==OfferConst::OFFER_TIMEOUT&&$offerInfo[status]!=OfferConst::OFFER_KONT}-->
		<a href="javascript:toKnot('{$offerInfo[id]}')">结贴</a>

		<!--{/if}-->

		<!--{if $offerInfo[uid]==MEMBER_ID &&$offerInfo[status]==OfferConst::OFFER_INIT}-->
		<a href="javascript:toKnot('{$offerInfo[id]}')">结贴</a>
		<!--{/if}-->
		<!--{if 'admin' == MEMBER_ROLE_TYPE }-->
		<a href="javascript:del('{$offerInfo[id]}')">删除</a>

		<!--{/if}-->
	</div>


	<!--{loop $offer_list $val}-->
	<div id="topic_list_25">
		<div class=" " id="topic_list_25">
			<div class="avatarL">
				<div class="avatar">
					<a href="index.php?mod=offer&view=me&uid=$val[uid]"
						class="nude_face"><img width="70" height="70"
						src="{$members[$val[uid]]['face']}"
						onerror="javascript:faceError(this);" /></a>

				</div>
				<div class="vText">
					<a href="index.php?mod=$val[uid]&type=offer">{$members[$val[uid]]['nickname']}{$members[$val[uid]]['validate_html']}</a>
				</div>
			</div>
			<div id="user_25_user"></div>


			<div class="Contant" style="position: relative;">
				<div id="topic_lists_25" style="_overflow: hidden">

					<!--{if $val[isWin]==1}-->
					<div id="vstar">
						<span>被采纳，满意度：</span>
						<ul>
							<!--{if $val[lv]>=1}-->
							<li class="on">1</li>
							<!--{else}-->
							<li>1</li>
							<!--{/if}-->
							<!--{if $val[lv]>=2}-->
							<li class="on">2</li>
							<!--{else}-->
							<li>2</li>
							<!--{/if}-->
							<!--{if $val[lv]>=3}-->
							<li class="on">3</li>
							<!--{else}-->
							<li>3</li>
							<!--{/if}-->
							<!--{if $val[lv]>=4}-->
							<li class="on">4</li>
							<!--{else}-->
							<li>4</li>
							<!--{/if}-->
							<!--{if $val[lv]>=5}-->
							<li class="on">5</li>
							<!--{else}-->
							<li>5</li>
							<!--{/if}-->

						</ul>

					</div>
					获得分数：{$val[num]}
					<!--{/if}-->
					<br />
					<div class="topicTxt">回复内容 : {$val[replys]}</div>
					<!--{loop $val[images] $iv}-->
					<img src="{$iv[photo]}" width="150" height="150" class="showcursor">
					<!--{/loop}-->
					回复时间:{echo date("Y-m-d",$val[timeline])}

					<!--{if $val[isWin]!=1}-->
					<!--{if $val[uid]!=MEMBER_ID && $offerInfo[uid]==MEMBER_ID}-->
					<a href="javascript:accept('{$val[id]}')">采纳</a>

					<!--{/if}-->
					<!--{/if}-->


					<!--{if $offerInfo[uid]==MEMBER_ID}-->
					<a href="javascript:delreply('{$val[id]}')">删除</a>
					<!--{/if}-->

				</div>
			</div>

		</div>
	</div>
	<!--{/loop}-->








	<div class="one_comment" {if MEMBER_ID
		<1} onclick="ShowLoginDialog();" {/if} >

		<li> 
	<textarea name="content" id="i_already_view" rows="3"></textarea>






    </li>
    
    <li class="from" style="position:relative;">
    <div class="mycome" style="overflow: visible;">
     <!--{if $this->Config['face_enable']}-->
     <script type="text/javascript">
						$(document).ready(function() {
							$(".reply_menu_bqb_c").click(function() {
								$("#reply_face").show();
								$('.rf_at_user').hide();
								$(".insertImgDiv").hide();
								$(".insertAttachDiv").hide();
							});
							$("#reply_atuser_view").click(function() {
								$("#atuser_reply_view").show();
								$(".forward_f2").hide();
								$(".forward_f").hide();
								$(".insertAttachDiv").hide();
								$(".modify_face").hide();
								$(".insertImgDiv").hide();
							});
							$(".menu_hpb_c1").click(function() {
								$("#atuser_reply_view").hide();
							});
						});
					</script>
     <div class="ins">
	 <div class="menuf_bq">
	 <b class="reply_menu_bqb_c"><a href="javascript:void(0);" onclick="topic_face('reply_face','i_already_view');return false;">表情</a></b>
	 <div id="reply_face" class="reply_face forward_f2"></div>
	 </div>
	 </div>

     <!--{/if}-->
      
      <!--{if $this->Config['image_enable']}-->
      <div class="comment_p_b2 comment_p_b22" id="reply_image_uploadify_{$topic_info[tid]}">
      <div onclick="imageUploadifyHTML('{$topic_info[tid]}', 'i_already_view', 'reply_image_uploadify_{$topic_info[tid]}', 1);" class="menuf_tq"><b class="menu_tqb_c">图片</b></div>
      </div>
      <!--{/if}-->
      
	  <!--{if $this->Config['attach_enable']}-->
      <div class="comment_p_b2 comment_p_b22" id="reply_attach_uploadify_{$topic_info[tid]}">
      <div onclick="attachUploadifyHTML('{$topic_info[tid]}', 'i_already_view', 'reply_attach_uploadify_{$topic_info[tid]}', 1);" class="menuf_fj menu_fj_reply_style"><b class="menu_fjb_c">附件</b></div>
      </div>
      <!--{/if}-->

	  <div class="comment_p_b2 comment_p_b22 sendInsertfocus"><div class="menu_hp"><b class="menu_hpb_c" id="reply_atuser_view" onclick="showatuserw('i_already_view','reply','view');return false;">朋友</b><div class="menu_hpb rf_at_user" id="atuser_reply_view"><span class="arrow-up"></span><span class="arrow-up-in"></span><div class="menu_tb showusr"><div id="showatuser_reply_view" class="showatuser"></div><sub class="menu_hpb_c1"></sub></div></div></div></div>
     </div>
     
     <div style="float:right;">
     <div style="float:right;">
	 <!--{if $this->yxm_title}-->
	 <input type="hidden" id="yxm_rtopicpub" onclick="publishSubmit('rpublishSubmit','btnText','i_already_view','replytid','rl','topictype');return false;">

	 <input id="rpublishSubmit" onclick="saveReply('{$offerInfo[id]}')" type="button" value="回 复" class="btnText" title="按Ctrl+Enter快捷发布"  />
	 <!--{else}-->
	<input id="rpublishSubmit" onclick="saveReply('{$offerInfo[id]}')" type="button" value="回 复" class="btnText" title="按Ctrl+Enter快捷发布"  />
	 <!--{/if}-->
	 </div>
     <div class="view_r2">
     <!--{if in_array($root_type, get_topic_type('forward'))}--> 
	 <div class="view_r1"><input name="topictype" type="checkbox" id="topictype" value="reply" onclick="select_checked();"/><label for="topictype" style="cursor:pointer;">转发给粉丝</label> </div>
	 <!--{else}-->
	 <input name="topictype" type="hidden" id="topictype" value="reply"/>
	 <!--{/if}-->
     </div>
     </div>
     </li>
	 <!--{if $this->yxm_title}-->
	 <li id="yxm_pub_buttonr" onclick="YXM_popBox(this,'rreply','{$this->yxm_title}');" style="margin-left:150px;height:1px;">&nbsp;</li>
	 <!--{/if}-->
	 <!--底部发布框 End-->
    </div>








</div>






<link
	href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

<script>
	function accept(id) {
		$("#replyId").val(id);

		$("#accept").dialog({
			width : 360,
			buttons : [ {
				text : "提交",
				click : toaccept
			} ]
		});
	}

	function saveReply(id) {
		$.post("index.php?mod=offer&code=saveReply", {
			"oid" : id,
			"replys" : $("[name=content]").val()
		}, function(response) {
			if (response.status == 0) {
				alert(response.info);
			} else {
				location.reload();
			}
		});
	}

	function toKnot(id) {
		$.post("index.php?mod=offer&code=toKnot", {
			"id" : id
		}, function(response) {
			if (response.status == 0) {
				alert(response.info);
			} else {
				location.reload();
			}
		});

	}
	
	
	function del(id) {
		$.post("index.php?mod=offer&code=del", {
			"id" : id
		}, function(response) {
			if (response.status == 0) {
				alert(response.info);
			} else {
				location = 'index.php?mod=offer';
			}
		});

	}

	function delreply(id) {
		$.post("index.php?mod=offer&code=delreply", {
			"id" : id
		}, function(response) {
			if (response.status == 0) {
				alert(response.info);
			} else {
				alert(response.info);
				location.reload();
			}
		});
	}

	var toaccept = function() {
		$.post("index.php?mod=offer&code=accept", {
			"id" : $("#replyId").val(),
			"lv" : $("#lv").val(),
			"desc" : $("#desc").val(),
			"num" : $("#num").val(),
			"kont":$("#kont").val()
		}, function(response) {
			if (response.status == 0) {
				alert(response.info);
			} else {
				alert(response.info);
				location.reload();
			}
		});

	}
</script>


<div id="accept" title="采纳" style="display: none">
	<input type="hidden" id="replyId"> <input type="hidden" id="lv" />
	<div id="star">
		<span>满意度</span>
		<ul>
			<li><a href="javascript:;">1</a></li>
			<li><a href="javascript:;">2</a></li>
			<li><a href="javascript:;">3</a></li>
			<li><a href="javascript:;">4</a></li>
			<li><a href="javascript:;">5</a></li>
		</ul>
		<span style="display: none"></span>
		<p style="display: none"></p>
	</div>
	<br> 给 分:<input id="num" />剩余{$zhb}个智慧币 <br>评 价:
	<textarea id="desc" rows="" cols="18"></textarea>
	<input id="kont" type="checkbox" value="1">同时结贴
</div>

<script type="text/javascript">
	var oStar = document.getElementById("star");
	var aLi = oStar.getElementsByTagName("li");
	var oUl = oStar.getElementsByTagName("ul")[0];
	var oSpan = oStar.getElementsByTagName("span")[1];
	var oP = oStar.getElementsByTagName("p")[0];
	var i = iScore = iStar = 0;
	var aMsg = [ " | ", " ， ", " | ， ", " | ， ， ", " | " ]

	for (i = 1; i <= aLi.length; i++) {
		aLi[i - 1].index = i;
		aLi[i - 1].onmouseover = function() {
			fnPoint(this.index);
		};

		aLi[i - 1].onmouseout = function() {
			fnPoint();
			oP.style.display = "none"
		};

		aLi[i - 1].onclick = function() {
			$("#lv").val(this.index);
			iStar = this.index;
			oP.style.display = "none";
			oSpan.innerHTML = "<strong>" + (this.index) + " 分</strong> ("
					+ aMsg[this.index - 1].match(/\|(.+)/)[1] + ")"
		}
	}

	function fnPoint(iArg) {
		iScore = iArg || iStar;
		for (i = 0; i < aLi.length; i++)
			aLi[i].className = i < iScore ? "on" : "";
	}
</script>

{template "topic_footer"}
